﻿using CYZH.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CYZH.Service.Drought
{
    public class AIService
    {
        /// <summary>
        /// 计算AI
        /// </summary>
        /// <param name="grassFile">最大产草量</param>
        /// <param name="avgFile">参照年份</param>
        /// <param name="shpfile"></param>
        /// <param name="saveRaster"></param>
        /// <returns></returns>
        public int CalculateAI(string grassFile, string avgFile, string shpfile, string saveRaster)
        {
            
            string msg;
            int i = CYZHLibrary.HZ.AI.CaculateAI(grassFile, avgFile, shpfile, saveRaster, out msg);
            Logger.Singleton.Debug(msg);
            return i;

        }
        public string AIStatistics(string oldRasterFile,string shpfile)
        {
            string msg;
           
            string strjson;
            int i = CYZHLibrary.Common.GdalTools.AIStatistics(oldRasterFile, out strjson, shpfile, "code", out msg);
            Logger.Singleton.Debug(msg);
            return strjson;
        }
    }
}
